package com.example.exam.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;

/**
 * @author shishuqian
 * date 2021/4/25
 * time 20:22
 * 描述:选择题的选项
 **/
@Data
@Entity
@Table(name = "t_choice")
@ApiModel(value = "问题的选项对象")
public class Choice implements Serializable {

    private static final long serialVersionUID = 8523481713349015998L;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;  //选项id

    @ApiModelProperty(value = "选项内容",required = true,example = "因为有个狗")
    private String content;  //选项内容

    @ApiModelProperty(value = "该选项是否是正确答案",required = true,example = "true")
    private Boolean rightAnswer;

    //统计此选项被选次数
    @Transient
    private Integer count;

    //统计答案占的百分比
    @Transient
    private String percent;


}
